VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form FrmLoading 
   Appearance      =   0  'Flat
   BackColor       =   &H00000000&
   BorderStyle     =   0  'None
   Caption         =   "Loading..."
   ClientHeight    =   3960
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   6090
   Icon            =   "FrmLoading.frx":0000
   LinkTopic       =   "Form1"
   MouseIcon       =   "FrmLoading.frx":74F2
   ScaleHeight     =   3960
   ScaleWidth      =   6090
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.Timer Animate 
      Interval        =   10
      Left            =   720
      Top             =   5160
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   240
      TabIndex        =   0
      Text            =   "0"
      Top             =   5280
      Visible         =   0   'False
      Width           =   375
   End
   Begin ComctlLib.ProgressBar ProgressBar 
      Height          =   135
      Left            =   720
      TabIndex        =   1
      Top             =   2760
      Width           =   4335
      _ExtentX        =   7646
      _ExtentY        =   238
      _Version        =   327682
      Appearance      =   1
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "%"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   5280
      TabIndex        =   4
      Top             =   2760
      Width           =   495
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "Please wait while billing loading your data......."
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   960
      TabIndex        =   3
      Top             =   3000
      Width           =   4095
   End
   Begin VB.Label TxtLoad 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Please Wait While Billing Loading Your Data..."
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   7800
      Width           =   6375
   End
   Begin VB.Image Image1 
      Height          =   3885
      Left            =   50
      Top             =   50
      Width           =   6000
   End
End
Attribute VB_Name = "FrmLoading"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim lokasidata As String
Dim user As String
Dim namadata As String
Dim pass As String
Dim port As String
Dim datver As String

Private Sub Form_Activate()
 Call SetPassword
End Sub
Private Sub Form_Load()
On Error GoTo fuckerr
datver = FrmDatabases.txtdatabases.Text
lokasidata = FrmDatabases.txtlokda.Text
user = FrmDatabases.TxtUser.Text
namadata = FrmDatabases.txtnameda.Text
pass = FrmDatabases.txtpass.Text
port = FrmDatabases.txtport
If FrmDatabases.txtlokda.Text = "" Then
Animate.Enabled = False
Load FrmDatabases
FrmDatabases.Show 1
Unload Me
Else
Set Image1.Picture = LoadPicture(App.path & "/Resource/LG.blc")
conn.CursorLocation = adUseClient
 conn.Open "Driver=" & datver & ";SERVER=" & lokasidata & ";PORT=" & port & ";DATABASE=" & namadata & ";USER=" & user & ";PASSWORD=" & pass & ";OPTION=3;"
   Call CekKey
   Call Main
   End If

IfNoErr:
Exit Sub
fuckerr:
   If Err.Number = -2147467259 Then
   MsgBox "Databases error, check your databases to continue.", vbInformation, "Error"
   Load FrmDatabases
   FrmDatabases.Show 1
   Else
    TulisError Err.Description, Err.Number, "Form_Load", Me.Name
   End If

   Resume IfNoErr
End Sub
Private Sub SetPassword()
On Error GoTo hell
    rec.Open "SELECT useraccount.* FROM useraccount", conn, adOpenStatic, adLockOptimistic
    If rec.RecordCount = 0 Then
    Animate.Enabled = False
        MsgBox "Password Belum di buat. Redirect ke pembuatan password ", vbInformation, "Run Program For First Time"
        Load FrmFirstPassword
       FrmFirstPassword.Show
        Unload Me
    Else
        Call Animate_Timer
    End If
    rec.Close
IfNoErr:
Exit Sub
hell:
 TulisError Err.Description, Err.Number, "Setpassword", Me.Name
 Resume IfNoErr
End Sub
Private Sub Animate_Timer()
On Error GoTo hell
Text1.Text = Val(Text1.Text) + 1
Label2.Caption = Text1.Text & " %"
ProgressBar.value = Text1.Text
        TxtLoad.Refresh
If Text1.Text = 100 Then
Unload Me
    Load FrmLogin
    FrmLogin.Show
    End If
hell:
IfNoErr:
Exit Sub

MsgBox "An Error In " & Me.Name & ". See Error.log for detail", vbCritical, "Error Handling"
TulisError Err.Description, Err.Number, "SetPassword", Me.Name
Resume IfNoErr
End Sub


